[02/30] Add a SysRq option to lift kernel lockdown
authorKyle McMartin <kyle@redhat.com>
Mon, 18 Feb 2019 12:44:57 +0000 (12:44 +0000)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 13 Feb 2020 05:14:49 +0000 (05:14 +0000)
commiteed6705b8a65336209a0b22e16dc12f7a43ce4e7
treed28b4a33a10e40060506730bf624e7514f0deba4
parent4cd13ab171f68233aa70dc3ba479727e4b11aad4
[02/30] Add a SysRq option to lift kernel lockdown

Origin: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit?id=a420ebff9e6d0153119096706918e3925ea860fc

Make an option to provide a sysrq key that will lift the kernel lockdown,
thereby allowing the running kernel image to be accessed and modified.

On x86 this is triggered with SysRq+x, but this key may not be available on
all arches, so it is set by setting LOCKDOWN_LIFT_KEY in asm/setup.h.
Since this macro must be defined in an arch to be able to use this facility
for that arch, the Kconfig option is restricted to arches that support it.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: x86@kernel.org
[bwh: Forward-ported to upstream lockdown:
 - Change config dependency to SECURITY_LOCKDOWN_LSM
 - Compare kernel_locked_down with LOCKDOWN_NONE instead of treating it
   as a bool
 - Adjust filenames, context]

Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name add-a-sysrq-option-to-lift-kernel-lockdown.patch
arch/x86/include/asm/setup.h
drivers/input/misc/uinput.c
drivers/tty/sysrq.c
include/linux/input.h
include/linux/sysrq.h
kernel/debug/kdb/kdb_main.c
security/lockdown/Kconfig
security/lockdown/lockdown.c